<template>
  <el-dialog
  title="题目审核"
  :visible="isShowExamine"
  @close='close'
  width="30%">
  <el-radio v-model="form.chkState" :label=1>通过</el-radio>
  <el-radio v-model="form.chkState" :label=2>拒绝</el-radio>
  <el-input
  type="textarea"
  :rows="2"
  placeholder="请输入审核意见"
  v-model="form.chkRemarks">
</el-input>
  <span slot="footer" class="dialog-footer">
    <el-button @click="close">取 消</el-button>
    <el-button type="primary" @click="onSave">确 定</el-button>
  </span>
</el-dialog>
</template>

<script>
import { choiceCheck } from '@/api/hmmm/questions.js'
export default {
  props: {
    isShowExamine: {
      type: Boolean,
      required: true
    },
    examineInfo: {
      type: Object,
      required: true
    }
  },
  data () {
    return {
      textarea: '',
      form: {
        chkState: 1,
        chkRemarks: '',
        id: ''
      }
    }
  },

  created () {

  },

  methods: {
    // 关闭弹层
    close () {
      this.$emit('onClose', false)
      this.form.chkRemarks = ''
    },
    // 保存
    async onSave () {
      this.form.id = this.examineInfo.id
      if (!this.form.chkRemarks) {
        this.$message.warning('请输入审核意见')
        return
      }
      await choiceCheck(this.form)
      this.$emit('onSuccess')
    }
  }
}
</script>

<style scoped lang='scss'>
::v-deep .el-input--medium{
  margin-top: 18px;
}
</style>
